package org.xilin

import org.apache.log4j.MDC

class ViewFilters {

    def filters = {
        noCache(controller:'*', action:'*') {
            before = {
                
            }
            after = {
                response.addHeader("Cache-Control","no-cache" )
                response.addHeader("Cache-Control","no-store" )
            }
            afterView = {
                
            }
        }

        log(controller:'*', action:'*') {
            before = {
                if (session?.user) MDC.put('user', session.user)
            }
            after= {
                MDC.remove('user')
            }
        }
    }
    
}
